package com.web.dao.impl;

import com.web.dao.UserDAO;
import com.web.entity.User;
import com.web.util.JDBCUtils;

import java.util.List;

public class UserDAOImpl implements UserDAO {

    @Override
    public User selectUserByUsername(String username) {
        List<User> users = JDBCUtils.query(User.class, "select id, username, password from tb_user where username=?", username);
        if(users.size()>0){
            return users.get(0);
        }
        return null;
    }
}
